﻿@{
    Layout = "~/Views/Shared/_m_Main.cshtml";
}
<div class="container">
    <div class="row">
        <div class="span3">
            <ul class="nav nav-tabs nav-stacked">
                <li class="active"><a href="/m/authorcenter"><i class="icon-user"></i><strong>个人中心</strong></a></li>
                <li><a href="/m/authorcenter">我的投稿</a></li>
                <li><a href="/m/myorders">我的约稿 
                @if(ViewBag.OrderCount > 0)
                {
                    <span class="badge badge-warning">@ViewBag.OrderCount</span>
                }
                </a></li>
                @*<li><a href="/m/profile">个人信息</a></li>*@
                <li class="active"><a href="/m/resetpassword">修改密码</a></li>
            </ul>
        </div>
        <div class="span9">
            <blockquote>
                <p>
                    <strong>修改密码</strong></p>
                <small>请妥善保管您的密码！</small>
            </blockquote>
            <hr />
            <form id="form1" action="/m/resetpassword" method="post" class="form-horizontal">
            <div class="control-group">
                <label class="control-label">
                    原密码
                </label>
                <div class="controls">
                    <input type="password" name="oldPwd" class="span4 {required:true,minlength:6,maxlength:18}"
                        placeholder="请输入当前使用的密码" />
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                    新密码
                </label>
                <div class="controls">
                    <input type="password" id="txtpassword" name="newPwd" class="span4 {required:true,minlength:6,maxlength:18}"
                        placeholder="请输入新密码" />
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                    重复密码
                </label>
                <div class="controls">
                    <input type="password" id="txtconfirm" name="confirm" class="span4 {required:true,equalTo:'#txtpassword'}"
                        placeholder="请再次输入新密码" />
                </div>
            </div>
            <div class="control-group">
                <div class="controls">
                    @if (!String.IsNullOrEmpty(ViewBag.Message))
                    {
                        if (ViewBag.Success)
                        { 
                        <label>
                            <p class="text-success">
                                @ViewBag.Message</p>
                        </label>
                        }
                        else
                        { 
                        <label>
                            <p class="text-error">
                                @ViewBag.Message</p>
                        </label>
                        }
                    }
                    <input type="submit" class="btn btn-info" style="width: 20%" value="修改密码" />
                </div>
            </div>
            </form>
            <hr />
        </div>
    </div>
</div>
@section tail
{
    <script type="text/javascript" src="/scripts/jquery.validate.js"></script>
    <script type="text/javascript" src="/scripts/jquery.metadata.js"></script>
    <script type="text/javascript">
        $(function () {
            $('#likcenter').addClass('active');
            $('#form1').validate({
                errorClass: "help-inline",
                errorElement: "span",
                highlight: function (element, errorClass, validClass) {
                    $(element).parents('.control-group').addClass('error');
                },
                unhighlight: function (element, errorClass, validClass) {
                    $(element).parents('.control-group').removeClass('error');
                }
            });
        });
        function Refalsh(sender) {
            validation.Refalsh(sender);
        }
    </script>
}
